//
// Created by hgx on 2021/12/17.
//

#ifndef UNTITLED_SCENE_H
#define UNTITLED_SCENE_H
#include <vector>
#include <cstdint>
#include <entt/entt.hpp>
#include <filesystem>


namespace  Bonnie
{
    class Scene {

    public:
        void Init(){

        }
    public:
        uint32_t AddEntity();
        void DeleteEntity(uint32_t entity)
        {
            auto c = mRegistry.create();
            entt::entity e = (entt::entity)entity;
        }

        template<class Component>
        void EmplaceComponent(uint32_t entity);

        template<class Component>
        void RemoveComponent(uint32_t entity);

        void Serialize(const std::string &fileName);
        void UnSerialize(const std::string &path);

    private:
        //void RegisterSystem
    private:
        entt::registry mRegistry ;
    };

    template<class Component>
    void Scene::EmplaceComponent(uint32_t entity) {

        mRegistry . template emplace<Component>(static_cast<entt::entity>(entity));
    }

    template<class Component>
    void Scene::RemoveComponent(uint32_t entity) {
        mRegistry. template remove<Component>(entity);
    }


}

#endif //UNTITLED_SCENE_H
